#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main(void)
{
	int i = 0;
	char ch = 0;
	while ((ch = getchar()) != EOF)
	{
		switch (ch)
		{
		case '\n':printf("\\"); printf("n"); i = 0; break;
		case '\t':printf("\\"); printf("t"); break;
		case ' ':printf("^"); putchar(ch+64); break;
		default:putchar(ch); break;
		}
		if (i++ == 9)
		{
			printf("\n");
			i = 0;
		}
	}

	return 0;
}